package jiali.model;

public enum TestEnum1 {

    MONDAY((byte)1, "星期一"),
    TUESDAY((byte)2, "星期二"),
    WEDNESDAY((byte)3, "星期三"),
    THURSDAY((byte)4, "星期四"),
    FRIDAY((byte)5, "星期五"),
    SATURDAY((byte)6, "星期六"),
    SUNDAY((byte)7, "星期日");

    private final Byte code;
    private final String message;

    TestEnum1(Byte code, String message) {
        this.code = code;
        this.message = message;
    }


    public Byte getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    public static String getMessageByCode(Byte code) {
        for (TestEnum1 testEnum1 : TestEnum1.values()) {
            if (testEnum1.getCode().equals(code)) {
                return testEnum1.getMessage();
            }
        }
        return null;
    }
}
